<script setup>
import HomeAside from '@/pages/HomeAside/HomeAside.vue'
import HomeHeader from '@/pages/HomeHeader/HomeHeader.vue'
import { ref } from 'vue'

const collapse = ref(false)

function handleCollapseEvent(value) {
  collapse.value = value
}
</script>

<template>
  <el-container>
    <el-aside :width="collapse ? '60px' : '160px'">
      <HomeAside :collapse="collapse" />
    </el-aside>
    <el-container>
      <el-header>
        <HomeHeader @collapse-event="handleCollapseEvent($event)" />
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<style lang="scss" scoped>
.el-container {
  width: 100%;
  height: 100%;

  .el-aside {
    height: 100%;
    transition: width 0.1s ease;
  }

  .el-header {
    background-color: #fff;
    height: 64px;
    padding: 0;
    border-bottom: 1px solid #e5e7eb; /* 淡灰色边框 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* 轻微阴影效果 */
  }

  .el-main {
    padding: 0;
    width: 100%;
  }
}
</style>
